import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import 'element-ui/lib/theme-chalk/index.css';
import '../public/global.css'
import axios from 'axios'
import './assets/global.css'
//导入富文本编辑器和样式
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
//导入treetable 插件
import TreeTable from 'vue-table-with-tree-grid'
//使用富文本编辑器
Vue.use(VueQuillEditor)
//设置生产提示工具
Vue.config.productionTip = false
//设置axios 
Vue.prototype.$http=axios
//设置测试接口的前缀
axios.defaults.baseURL='http://127.0.0.1:8888/api/private/v1/'
//设置路由拦截器
axios.interceptors.request.use(config => {
  // console.log(config);
  config.headers.Authorization=window.sessionStorage.getItem('token');
  return config 
})
Vue.filter('goodsDate',function(creatTime){
    const dt=new Date(creatTime)
    const year=dt.getFullYear()
    const month=(dt.getMonth()+1+'').padStart(2,'0')
    const date=(dt.getDate()+'').padStart(2,'0')
    const hour=(dt.getHours()+'').padStart(2,'0')
    const minutes=(dt.getMinutes()+'').padStart(2,'0')
    const seconds=(dt.getSeconds()+'').padStart(2,'0')
    return `${year}/${month}/${date} ${hour}:${minutes}:${seconds}`
})
Vue.component('tree-table',TreeTable)
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
